package com.test.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

// 等价于 <bean id="user" class="com.test.pojo.User"/>
// @Component 组件
@Component
@Scope("singleton")  //标注为单例模式
public class User {
    @Value("小明")  //赋值  相当于 <property name="name" value="小明"/>
    public String name;
}
